Skip to content

Fix DEIM system construction by completing system before return#122

Merged
bowenszhu merged 2 commits into
mainfrom
b/fix-deim-complete-system
Nov 13, 2025
Merged

Fix DEIM system construction by completing system before return#122
bowenszhu merged 2 commits into
mainfrom
b/fix-deim-complete-system

Conversation

@bowenszhu

Copy link
Copy Markdown
Member

The DEIM tutorial is broken due to changes in ModelingToolkit.jl. After calling deim(), attempting to create an ODEProblem from the returned system fails.

using ModelOrderReduction
snapshot_simpsys = Array(sol.original_sol)
pod_dim = deim_dim = 5
deim_sys = deim(simp_sys, snapshot_simpsys, pod_dim)
deim_prob = ODEProblem(deim_sys, nothing, tspan)
deim_sol = solve(deim_prob, Tsit5())

Add a call to complete(sys) at the end of the deim() function before returning. According to the ModelingToolkit documentation, complete() marks a system as finalized and performs necessary preprocessing to register all components in the global structure. This allows subsequent operations like ODEProblem construction to correctly find all required variables and their initial conditions.

@bowenszhu
bowenszhu merged commit 4a4ab24 into main Nov 13, 2025
5 of 7 checks passed
@bowenszhu
bowenszhu deleted the b/fix-deim-complete-system branch November 13, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant